<%# Redmine plugin for Document Management System "Features"
#
# Copyright (C) 2013   Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.%>

<h3 class="title"><%= l(:field_label_dmsf_workflow) %></h3>
<%= form_tag({:controller => 'dmsf_workflows', :action => 'assignment'},
              :method => :post,
              :id => 'assignment-form') do %>
  <%= hidden_field_tag :dmsf_file_revision_id, params[:dmsf_file_revision_id] %>
  <p>
    <%= label_tag('workflow', "#{l(:link_workflow)}:") %>
    <%= select_tag(
        'dmsf_workflow_id',
        dmsf_workflows_for_select(@project, nil))%>
  </p>
  <% if User.current.allowed_to?(:manage_workflows, @project) %>
    <p>
      <%= link_to l(:label_dmsf_workflow_new), new_dmsf_workflow_path, :class => 'icon icon-add' %>
    </p>
  <% end %>
  <p class="buttons">
    <%= submit_tag l(:button_submit), :name => 'commit', :onclick => 'hideModal(this);' %>
    <%= submit_tag l(:button_cancel), :name => 'commit', :onclick => 'hideModal(this);' %>
  </p>
<% end %>
